Method and apparatus for sorting materials using electromagnetic sensing

ABSTRACT

An automated interrupt driven system which employs a circular buffer is used to sort materials based on differing electromagnetic radiation absorption and penetration characteristics. The system has a conveyor and a source of electromagnetic radiation which radiates materials travelling along the conveyor. A controller samples detector outputs at various times to evaluate the absorption and penetration characteristics of the materials to be sorted, based on a plurality of samples. Portions of the materials are ignored to obtain accurate readings from the detectors. Based on the detected penetration and absorption characteristics, the controller activates ejection mechanisms causing materials of different compositions to be deposited into different bins. The controller executes interrupts to cause detection, ejection, testing, and system history maintenance at required times. The circular buffer contains indices which point to various locations which are programmed in memory to trigger and perform specific events. The location of the indices in the circular buffer is used to control event timing, such as activating and deactivating the ejection mechanisms. This configuration, allows several events to be executed simultaneously by moving to the next location in the circular buffer while the event indicated by the index in the previous location continues in progress.

This invention was made with Government support under Contract No.68D80025 having an effective date of Aug. 18, 1988, awarded by theEnvironmental Protection Agency. The Government has certain rights inthis invention.

BACKGROUND OF THE INVENTION

This is a continuation-in-part of U.S. patent application Ser. No..[.07/605,933.]. .Iadd.07/605,993 .Iaddend.filed Oct. 29, 1990 now U.S.Pat. No. .[.5,269,576.]. .Iadd.5,260,576.Iaddend..

The disclosed invention classifies materials by utilizing the tendencyof penetrating electromagnetic radiation to pass through differingmaterials with differing levels of attenuation within the materialsaccording to their chemical properties. The invention provides forseparation of the differing materials from each other according to theamount of radiation passing through them. More specifically, penetratingelectromagnetic radiation is used to simultaneously scan multiplematerial items as they pass through a region of radiation. Analysis ofthe measured radiation passed through differing portions of the body ofeach item is used to classify each item and activate means forseparating from each other items which have differing chemicalproperties.

It is well known that for materials having similar thicknesses, thosematerials comprised of elements having a lesser atomic number generallyallow a greater degree of penetrating electromagnetic radiation to passthrough them then do those materials comprised of elements having agreater atomic number. Additionally, it is also well known that formaterials having similar chemical properties, those materials of lesserthickness generally allow a greater degree of penetratingelectromagnetic radiation to pass through them than do those materialsof greater thickness. Therefore materials of differing chemicalproperties can be selected according to the amount of penetratingelectromagnetic radiation passing through them, if differences inthicknesses of the materials have relatively less effect on thetransmission of penetrating electromagnetic radiation through them thando differences in chemistry.

In the recycling of waste or secondary materials it is very useful to beable to separate mixtures of materials into usable fractions, eachhaving similar chemical properties. For instance it is useful toseparate plastic materials from glass materials, to separate metals fromnonmetals, to separate differing plastics from each other, and toseparate dense materials from less dense materials. There are many othersuch useful separations practiced in industry using many differentmethods which are too numerous to enumerate herein.

It has been found that in separating mixtures of materials forrecycling, the disclosed invention is very effective at distinguishingand separating items of differing chemical composition. Mixturescontaining metals, plastics, textiles, paper, and/or other such wastematerials can be separated, since penetrating electromagnetic radiationtypically passes through the items of different materials to differingdegrees. Such mixtures occur frequency in the municipal solid wasterecycling industry and in the secondary materials recycling industries.An example is the separation of aluminum beverage cans from mixturescontaining such cans and plastic containers. Such mixtures arecommonplace in curbside recycling programs. Another example is theseparation of chlorinated plastics (a source of corrosive gasses whenburned) from a municipal solid waste mixture to provide a less pollutingfuel for municipal waste incineration.

It has also been found that the invention is useful for separatingchlorinated plastics from mixtures containing nonchlorinated plastics,since it has been found that chlorinated plastics typically allow lesstransmission of penetrating electromagnetic radiation than dononchlorinated plastics. Such separation renders each of these plasticsmore valuable for recycling. Such mixtures of plastics are commonplacein municipal waste recycling programs. Until now such separations havebeen performed using methods which are cumbersome and slow, therebylimiting their usefulness. For instance in the United States, themanufacturers of plastic containers for consumables have recently begunmolding a numerical identification code into the base of the containers.The code indicates chemical composition, such as polyolefins,polyesters, or vinyls (polychlorinated plastics). Using these codes, theplastics can be manually hand-sorted from each other. However, thismethod is slow, labor intensive, and expensive and has not foundwidespread use for these reasons.

There exist three known processes for automated separation ofchlorinated plastics from mixtures of plastics according to theirresponse to electromagnetic radiation. One of these processes isdisclosed in European patent application No. 88107970.1 of Giovanni,filed May 18, 1988, and published on Nov. 23, 1988. Another process isdisclosed in U.S. Pat. No. 4,884,386, issued to Gulmini Carlo on Dec. 5,1989. The third process is known as the Rutgers process.

Each process requires that items in the mixture be placed singly into aradiation chamber, following which placement measurements are made toclassify the plastic item according to its response to anelectromagnetic radiation beam. Subsequently the plastic item isdirected to a destination according to its chemical composition. Afterthis sequence is completed, another plastic item is fed into theradiation region and the sequence is repeated. This requirement foroperation with single items necessitates elaborate equipment for singlyselecting items from the mixture and placing them one at a time intothese separators. Furthermore, since the plastics are required to besingle classified one after another, the methods are limited inthroughput because of the finite time required to execute the sequencefor each item.

Typical plastic containers for consumables are manufactured with thickerwalls at the neck and base than in their central portions. Such plasticcontainers, when flattened for storage or shipping reasons duringrecycling, typically contain folds incurred during the flatteningprocess. Necks, caps, bases and fold give rise to significant variationsin total material thickness presented to a penetrating electromagneticradiation beam. It has been found by the inventors that utilizingmeasures of radiation transmission through the neck, cap, base, or afolded region of a plastic container can give inaccurate results inattempting to classify the chemical composition of the container due tothese variations in total material thickness.

SUMMARY OF THE INVENTION

It has been found that the disclosed invention surmounts the abovementioned limitations and provides efficient high volume separations byallowing plastic materials to be fed multiply and in a continuous mannerwithout regard to orientation into a common region of penetratingelectromagnetic radiation. Simultaneous measurements are made on allitems as they move through the region of radiation, in order todistinguish and classify each plastic item according to its chemicalproperties and thicknesses. The items are then simultaneously directedto different destinations, according to their chemical properties andthicknesses. As a result of this capability of operation with multipleitems, the disclosed invention operates at a significantly greaterthroughput rate than the aforementioned processes and requires nospecialized means for singly placing materials into the radiationregion.

We have found that, in practice, taking a measurement through only arelatively thin cross section of an item required detailed knowledge ofthe geometry and orientation of the item (such as a container).Accordingly, placement of an item between a radiation source and aradiation detector, such that radiation passing through only arelatively thin cross section is measured, requires sophisticated andexpensive materials handling means. However, our invention overcomesthis limitation. We have found that use of high speed electronic signalprocessing circuitry to analyze a group of separate measurements takenthrough differing portions of the body of an item to be classified asits passes between the radiation source and radiation detector allowsselection of only those measurements of greater transmission rate foruse in classifying the item. Therefore specialized placement andorientation of the item between the source and detector is not required.

Accordingly it has been found that the method of the disclosed inventionof acquiring multiple separate measurements of radiation transmittedthrough different portions of the body of an item to be classified andusing high speed signal processing circuitry to identify and use onlythose measurements of highest transmission rate through the item toclassify the item overcomes uncertainties in classification arising fromvariations in total thickness of the item. It is noted that with ourinvention other signal processing algorithms which correlate theseparate measurements taken on an item could also be used such as, forexample, averaging the measurements or averaging the selectedmeasurements.

The disclosed invention employs an improved method for distinguishing,classifying and separating mixtures of material items which comprises:

(a) conveying the items multiply and in a continuous manner through aradiation region or zone of penetrating electromagnetic radiation,

(b) irradiating the multiple items simultaneously with penetratingelectromagnetic radiation as the items pass through the radiationregion,

(c) simultaneously acquiring for the multiple items a group of separatemeasurements for each item, each measurement within a group being ameasurement of the amount of penetrating electromagnetic radiationpassing through a different portion of the body of an item, and

(d) simultaneously directing the multiple items each to a destinationdetermined by analysis of the group of measurements of the amount oftransmission of penetrating electromagnetic radiation passing througheach item.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention shall be described with particularity by reference to theappended drawings in which:

FIG. 1 is a front perspective view of the apparatus for the separationof materials using penetrating electromagnetic radiation, made inaccordance with this invention, in which two sets of material items arebeing processed and separated;

FIG. 2 is an enlarged front elevation of the apparatus disclosed in FIG.1, illustrating a single item of the first set and a single item of thesecond set being moved over the slide conveyor;

FIG. 3 is a side elevation of the apparatus disclosed in FIG. 2,illustrating one uncrushed item of one set and one crushed item of asecond set of the material from moving over the slide conveyor;

FIG. 4-A is a graphic illustration of a crushed polyester plasticcontainer, typical of a first set of material items to be classified,and a graph illustrating the transmitted radiation measurements atvarious longitudinal portions of the container;

FIG. 4-B is a graphic illustration similar to FIG. 4-A illustrating acrushed PVC (polyvinyl chloride) container, and a graph illustratingcorresponding measurements of transmitted radiation along the container;and

FIG. 5 is a block circuit diagram of the electronic signal processingcircuitry.

FIGS. 6a-6h illustrate the steps performed in an initialization sequenceof a system according to the invention;

FIGS. 7a-7d illustrate the steps performed in a timer interrupt routinefor a system according to the invention;

FIGS. 8a-8b illustrate steps performed in a detector analog to digitalconversion interrupt routine in a system according to the invention;

FIGS. 9a-9b illustrate steps performed in a pressure transducerinterrupt routine in a system according to the invention;

FIG. 10 illustrates the steps performed in a foreground routine in asystem according to the invention;

FIGS. 11a-11c illustrate steps performed in a detect/eject algorithmroutine of a system according to the invention;

FIG. 12 illustrates a circular buffer as used in the invention.

DESCRIPTION OF THE EMBODIMENTS

According to the invention, materials having different electromagneticradiation absorption and penetration characteristics are separated.First, the materials are conveyed along a plurality of channels from atleast one inlet toward a plurality of outlets through a source ofelectromagnetic radiation. Portions of the materials conveyed areradiated with the electromagnetic radiation. A predetermined sequence ofdetectors is periodically polled. Each detector corresponds to achannel. The polling includes sampling for a predetermined sample timewith the detectors the electromagnetic absorption and penetrationcharacteristics of the material portions radiated. In response to theelectromagnetic radiation absorption and penetration characteristicsmeasured by the detectors, material ejection mechanisms are activated atdifferent times, so that materials having different electromagneticradiation absorption and penetration characteristics are ejected atdifferent times and locations on the conveyor into different sortingbins. In addition, the system allows simultaneous operation of differentsystem mechanisms, so that operations of the material ejectionmechanisms can be verified prior to polling the channel detectorcorresponding to the material ejection mechanism. Thus, it is notnecessary to verify operation of all material ejection mechanisms beforebeginning polling. It is only necessary that the corresponding channelbe verified prior to initiation of polling in that channel.

The ejection mechanisms are air pressure ejectors which produce airpressure data that can be measured by sensors and stored in a sequenceidentical to the sequence of the detectors polled. A fault can beindicated if the air pressure data measured and stored is less than apredetermined minimum.

It is also useful to ignore a portion of each item of material to beseparated. Therefore, an ignore time is counted from a time when adetection is made, so that although sampling takes place during thisignore time, the data is set aside for consideration only in specialcases. One such case is where the material sampled is of too small asize to permit entry into a sample interval following the ignore time.When sampling is initiated after the ignore time, the outputs of thedetectors are sampled a plurality of times during the sample intervaland a sample average is determined from the detector outputs and a countof the number of samples during the sample interval. The average iscompared to a predetermined material threshold. This material thresholdis a ratio equal to a predetermined amount of radiation transmittedthrough the material divided by the amount of radiation transmittedwithout the material present in the path between the radiation sourceand the detector. When the average is less than the predeterminedmaterial threshold, an air-on index is set to activate the air ejectionmechanism at a time and for a duration based on the sample count, theignore count, the amount of time it takes for the material to go fromthe detectors to the air pressure ejection mechanism and a response timeof a solenoid which activates the individual air ejection mechanisms. Bymeasuring and storing air pressure data from each ejection mechanism ina separation identical to the sequence of the detectors polled, a faultcan be indicated if the air pressure data measured is less than apredetermined minimum.

The system also includes a processor which controls the system operationand performs an initialization sequence. In the initialization sequence,variables are initialized and the number of detectors is compared withthe number of ejection mechanism for one to one correspondence. High andlow limits of detection and ejection mechanisms can be tested andoperation of fault indicators, verified In addition, the total operationtime, a system history and a record of errors can be provided. This isaccomplished by periodically interrupting detection processing to storesuch information.

To carry out these functions, the system has an acceleration slide, anelectromagnetic radiation source arranged above the acceleration slide,a plurality of detectors, with each detector corresponding to a channel,for measuring electromagnetic absorption and penetration characteristicsof material portions radiated, and a means for periodically polling apredetermined sequence of the detectors. Polling means includes asampler which is arranged to sample the detectors a plurality of timesfor a sample time. Ejection mechanisms, e.g., air pressure ejectors, areactivated by an activating means at different times as the materials areconveyed so that materials with different electromagnetic radiationabsorption and penetration characteristics are ejected at differentlocations on the acceleration slide into different sorting bins. Controlis achieved with a processor which maintains a current index. Thecurrent index represents a pointer in a circular buffer and identifies alocation in memory where current information is stored.

In the disclosed apparatus 10 in FIGS. 1-3, the source of penetratingelectromagnetic radiation may be either an X-ray source, a microwavesource, a radioactive substance which emits gamma rays, or any othersource of electromagnetic radiation, such as the X-ray tube 11, whoserays penetrate through a class of materials to be separated from amixture of materials. The preferred wavelength of radiation to be useddepends upon the physical and chemical properties of the items 13 and 14to be separated, since the amount of transmission through the items isdependent upon these factors. It is preferred to use wavelengths whichresult in transmissions of 10% to 90% of incident radiation passingthrough the items 13 and 14 to be separated, although other wavelengthscould be used. Radiation detectors 15 should be selected to be optimallysensitive to the radiation wavelengths used. The detectors should be ofhigh speed response, preferably with a response time of one millisecondor less to allow for accurate measurement with high throughput rates ofitems to be separated.

FIG. 1 is an illustration of the apparatus 10 in operation. A mixture oftwo types of materials 13 and 14 to be separated are delivered to theapparatus 10 via a feed conveyor 17. Conveyor 17 is selected so as todeliver the mixture of materials 13 and 14 in uniform fashion across thewidth of an acceleration slide 18. The acceleration slide 18 ispositioned at a declining angle to the horizontal such that the mixtureof items 13 and 14 upon it will move down the slide 18 under theinfluence of gravitational force, preferably accelerating to increasingspeeds as the items 13 and 14 progress down the slide 18, causing theitems to spread during their descent. As shown in FIG. 2, at the lowerend portion 19 of the slide 18 is an array 20 of radiation detectors 15positioned so that they span the width of the slide 18. The detectors 15are spaced apart so that any item 13 or 14 in the mixture to beseparated cannot pass over the array 20 without passing over at leastone detector 15.

Positioned above the detector array 20, as illustrated in FIG. 1, is acollimated source 11 of penetrating electromagnetic radiation. Source 11delivers a sheet-like beam of radiation which falls incident upon thewidth of the acceleration slide 18 in an area strip or radiation zone 22containing the radiation detector array 20, such that as items 13 and 14of the mixture pass through this beam. They pass between the radiationsource 11 and the detector array 20. Spaced downstream from the lowerend 19 of the acceleration slide 18 is a splitter 24 for segregatingseparated materials 13 and 14, which then fall onto conveyors 25 and 26placed on the two opposite sides of the splitter 24 for conveyance awayfrom the apparatus 10 to remote discharge areas, not shown. Of courseadditional splitters and sorting bins or other suitable dischargeapparatus can be employed.

Each detector 15 in the array 20 is connected to an electronic signalprocessing circuitry 28 as depicted in FIGS. 2 and 3, through leads 29and branch leads 30. The circuitry 28 is connected to an electromagneticair valve 32 through lead 33. The air valve 32 connects a reservoir 34of compressed gas or air to an air nozzle 35 located directly downstreamfrom each corresponding detector 15. Each detector 15, in combinationwith its associated circuitry, is capable of operating independently ofany other detector 15, together with its corresponding circuitry. Eachair valve 32 and air nozzle 35 combination is capable of operatingindependently of any other air valve 32 and its corresponding air nozzle35. In the apparatus 10 shown in FIG. 3, each detector 15 and itsassociated circuitry is connected to a single air valve 32 andcombination air nozzle 35, although in practice one or more adjacentdetectors 15 and its associated circuitry may be connected to one ormore air valves 35, in order to feed one or more air nozzles 35 whichspan the width of the corresponding adjacent detector 15.

In operation, signals are picked up by the detectors 15 and transmittedto signal acquisition, analog, and digital conversion circuitry 505.These signals are then transmitted to a microprocessor analyzer, such ascontroller 513, to identify the region of least thickness in thematerials treated. The analyzer then determines if that signal meets thecriteria for the material to be selected and energizes ejectionmechanisms, such as air valve circuitry to either activate the air valve32 or not.

As a material item 13 or 14 to be separated passes over the detectorarray 20 it passes between the radiation source 11 and one or moredetectors 15. Each detector 15 takes multiple measurements of theintensity of radiation passing through differing portions of the body ofthe item 13 or 14 as it passes over the detectors 15. These measurementsare analyzed by the electronic signal processing circuitry 28 connectedto each detector 15, applying selection algorithm to identify the itemas being of Type A or Type B, such as 13 or 14. If, in the casedepicted, the item 13 is identified as Type A, no action is taken andthe item 13 falls off the end of the slide 18 and onto the Type A itemconveyor 25. If the item identified as 14 is Type B, then thecorresponding air valve or air valves 32 are activated at theappropriate time to cause an air blast 37 (FIG. 3) to be emitted fromthe appropriate air nozzles 35, so as to eject the item 14 away from theend of the slide 18 and over the splitter 24 so that the item 14 fallsonto the Type B item conveyor 26.

As many items 13 or 14 as there are air nozzles 35 can be separatedsimultaneously in this manner. In the apparatus 10 depicted, up to eightitems can be separated simultaneously, since eight nozzles 35 areillustrated in the drawings. We have found that each detector 15,circuitry 28, air valve 32, and air nozzle 35 combination currently usedcan operate upon as many as ten items per second. Thus, the illustratedembodiment of the apparatus 10 is ultimately capable of classifying upto eighty containers per second.

FIG. 4-A depicts a typical flattened polyester plastic container 13(Type A) which has a neck N, central portion C, and base B, and whichcontains a fold F caused by the flattening process. A typical graph ofmeasurements of incident penetrating electromagnetic radiationtransmitted through corresponding portions of the container is shownbelow the container 13 and positioned such that a measurement oftransmitted radiation shown at a point along the graph corresponds tothe portion of the container directly above the graph. (For example,measurement Mc is vertically below a point on central portion C.) It canbe seen from the graph that in this example, radiation transmissionrates of from 20% to 80% can be measured depending upon which portion ofthe container the transmission being measured through. Similarly fromthe graph of FIG. 4-B PVC plastic container of similar geometry it canbe seen that measurements of transmission rate from 5% to 40% can beobtained.

A problem arises if only a threshold comparator (such as disclosed inGiovanni) is used in an attempt to distinguish between the polyester andPVC containers. In order to reliably distinguish the PVC container 14 inthe example of FIG. 4-B, a classification threshold set at less than 40%transmission would risk failing to recognize the container as PVC if themeasurement used was taken through a relatively thin cross section suchas through an unfolded central portion of the container (which caneasily occur if the container passes the radiation detector in anorientation such that the detector does not see a neck, cap, base, orfold). However, using a threshold comparator with the above mentioned40% classification threshold or greater for PVC when examining apolyester container 13 as in FIG. 4-A may cause the polyester container13 to be misclassified as PVC if the container passes the detector in anorientation such that the detector sees a neck, cap, base, or fold,since some of these measurements show a transmission rate of less than40%, which would trip the threshold comparator by its nature ofoperation.

Because of possible misclassifications arising from these types ofsignal overlap, we have determined that in general the most reliablemeasurements for making a classification are those measurements takenthrough those portions of the body of an item to be classified whichexhibit the greatest rates of transmission of radiation through the item(such as those taken through a relatively thin cross section such asthrough an unfolded central portion of the container).

A processor, such as either a central or distributed master computer,can implement system operation in accordance with the flow diagramsshown in FIGS. 6-11. Detection and ejection circuitry may also belocated on one or more remote boards, which may include remoteprocessors or computers. FIGS. 6-11 illustrate a system with fourchannels and a corresponding number of detectors and material ejectors.However, this is by way of illustration and not limitation, as it willbe clear to those of ordinary skill that any number of channels andcorresponding detectors and material ejectors can be employed.

The block diagram in FIG. 5 illustrates that external inputs areprovided by detectors 501 to detector signal conditioning andamplification circuits 503 in analog section 505. Detector sample andhold circuits 507 sample and hold the outputs of the detector signalconditioning and amplification circuits 503. Sample and hold circuits507 provide the conditioned signals to the analog multiplexer 509. AsFIG. 5 illustrates, each channel has its own detector and sample andhold circuit. Multiplexer 509 operates under the control ofmicrocontroller 513, which resides in digital section 515. In responseto microcontroller 513, analog multiplexer 509 delivers one of thechannel detector outputs to the A to D converter 511. The digitizedoutput from the A to D converter 511 is provided to microcontroller 513.It should be noted that microcontroller 513 also controls the samplingperformed by sample and hold detectors, as shown by signal line 517.Signal line 517 also transmits information from microcontroller 513 tothe pressure sensor sample and hold devices 519. These pressure sensorsample and hold circuits are used to sample the operation of the airvalve pressure sensors 521 as buffered by signal conditioning circuits523. The outputs of sample and hold circuits 519 are transmitted tomicrocontroller 513, as illustrated in FIG. 5. Microcontroller 513 alsocommunicates in a bi-directional manner with three memory devices.EEPROM 525 stores system parameters. EPROM 527 stores a program whichoperates microcontroller 513. RAM 529 stores digitized data. It shouldbe noted that the microcontroller operates channel OK indicators 531.Output section 533 contains air valve drivers 535 which are operated byoutputs by the microcontroller 513. The air valve drivers are used tocontrol the air ejection mechanism to provide air pressure that is usedto eject material into the correct bin after material has beenirradiated and scanned by the detectors. FIG. 15 also illustratesseveral auxiliary functions. One is system shut down output 537 andanother is serial communications interface 539, which can be routed to amonitor computer. In addition, manual fire switch debounce logic 541 canalso be used to manually active the air valve drivers 535 by activationof the corresponding fire channel switch 543.

The detector software such as that resident on a remote detector board,utilizes circular buffers to store data. Each channel uses two circularbuffers. One is used to store the data for detectors while the other isused to store data for the pressure transducers. A circular buffer 1201having N positions is shown in FIG. 12.

At initialization the buffer index 1203 is set to point to bufferposition 0. When the first data point is read, it is stored in position0. The buffer index 1203 is then incremented to the next bufferposition. Widen the next data point is read, the data is stored in thecircuit buffer at the position indicated by the buffer index. Again thebuffer index is incremented to the next buffer position. This processcontinues until the buffer index reaches the end of the buffer (positionN). At this time the buffer index is set to position 0. This is effectcreates a first-in-first-out circular buffer that maintains a history ofthe most recent N data points which are used by the detect/ejectalgorithm to determine plastic types, as described herein.

The circular buffer 1201 is also used to indicate relative points intime. This is critical to the proper timing of eject and pressuremeasurement events. When used as a relative time clock, the buffer index1203 is analogous to the minute hand on a clock. Events are scheduled tooccur at specific points in the buffer, just as one might schedule anevent, for example, at 15 minutes after the hour. When the buffer index1203 points to the scheduled position, the event is performed. This ishow the air-on and air-off indices are handled. Once it has beendetermined that material is to be ejected, the specific point in time tocause the ejection is calculated using the methods shown in theflowcharts of FIGS. 6-11. This point is marked on the circular buffer(relative time clock) as the air-on index. Once the air-on index isdetermined, the air-off index is calculated and likewise marked in thecircular buffer. When the buffer index points to the buffer marked asthe air-on index, a solenoid valve is energized to initiate the flow ofair used to eject material. When the buffer index points to the bufferposition marked as the air-off index, the solenoid valve is deenergized,interrupting the flow of air. Of course, this method could be employedto activate and deactivate any material ejection mechanism. In addition,the circular buffer can be used as an index for any relatively timedevents in the system.

Thus, the circular buffer used by the detector board software isdesigned to store the more recent N data points measured, as well asfunction as a relative time clock to schedule events accurately. The useof the circular buffer provides an efficient method of handling datastorage and time scheduling activities, which can be very intensive ifimplemented using other conventional approaches.

As previously mentioned, a processor, such as microcontroller 513, canbe used to direct operation of the system. In the initializationsequence shown in FIGS. 6a-6h the system can be checked so that overallsystem operation or individual channel operation can be verified andappropriate indicators illuminated. Steps 601 and 603 initializeprocessor functions and variables, respectively. To assure that theprogram code is operational, a checksum test is performed in step 605.Since the correct program code is necessary for system operation, ifstep 607 determines that the checksum test was not passed, control isrouted to block 609, which causes all the channel OK lights to blink onand off permanently until the error is corrected. Assuming the checksumtest did pass, then a read/write test is performed on a first portion ofrandom access memory in step 611. This assures that the first 8K of theRAM is operational. If the test does not pass as determined in step 613,an error code 4 is set in step 16 and the test mode is entered in step617. If the test did pass, then the second RAM is subjected to aread/write test in step 619. If this test does not pass, then step 621sets a different error code in step 623 and the test mode in step 617can again be entered.

The system can operate in two modes. In the first mode, the detectorsare independent, while in the second mode the detectors are paired forthe purpose of measuring the speed of the objects on the conveyor. Themode can be set by a DIP switch whose position is read in step 625. Instep 627 a number of detectors variable is set as required by the switchsetting. If step 629 determines that the detectors are not independent,step 631 sets the variable indicating the detectors are paired tomeasure speed. In this case, detectors 1 and 2 are paired, detectors 3and 4 are paired, etc. On the other hand, if the detectors areindependent, the variable is set indicating the detectors areindependent as indicated in step 633.

As previously indicated, the number of detectors and the number ofpressure transducers is typically the same. FIG. 6b shows that positions1-2 of the DIP switch indicate the number of detectors connected to theboard. Switch positions 3 and 4 determine the number of pressuretransducers connected to the board. The number of pressure transducersmust be equal to the number of detectors, unless the detectors are notindependent, in which case more than one detector is used to activate anejection mechanism. It is also possible to combine multiple detectionchannels into a single ejection channel. Thus, in step 635 the number ofpressure transducers is set as required by the switch setting.

In step 637, the controller determines if the test mode is selected. Ifthis is the case, test mode is entered as step 617. If not, in step 639the input to detector number 1 is read and recorded as a lower limit.This is done with the electromagnetic radiation source (e.g., X-raysource) turned off. If the level is not correct as determined in step641, a channel fault flag and corresponding error code is set as shownin step 643. In step 645, the number of detectors is tested to determineif the detectors have been exhausted. Steps 646-656 illustratecorresponding steps performed for four channels. As previouslymentioned, any number of channels can be implemented. It should also benoted that an error code corresponding to a failure in a particularchannel can be set.

Step 657 illustrates that a next step in the initialization sequence isdetermining if the reference amplitude for the A/D converter is correct.If this is not the case, as determined in step 658, an error code is setin step 659 and the test mode is entered via step 617. If the amplitudeis correct then, in step 660, the controller commands the input of thefirst pressure transducer to be read and recorded as a lower limit. Ifthe level is not correct as determined in step 661, then an error codefor that channel is set in step 662 and step 663 tests to determine ifthe number of transducers has been exhausted. Steps 664 through 674perform corresponding tests for the remaining channels.

If step 675 determines that any faults are set, then the channel OKlights for channels without faults are activated in step 676 and testmode is entered via step 617. If no faults have been set, then the boardfault light is turned off in step 677 to allow system initialization tocontinue and to permit activation of the electromagnetic radiationsource.

Steps 678-680 are used to determine if a request has been received froma remote computer to turn the electromagnetic radiation source on and ifthe request has been processed. Step 678 checks to see if theelectromagnetic radiation source has been turned on. If it has, controlis passed to step 681. If the source has not been turned on, a serialinterface is checked to see if a request has been made by the monitor ormaster computer for data from the board. Control is transferred fromstep 678 to 679 and 680 until the output of step 678 indicates that theelectromagnetic radiation source should be turned on. When this occurs,step 681 activates a fifteen second delay. With the X-rays on, step 682areads detector number 1 and records the value read as an upper limit.Step 682b tests if this level is OK. If not, step 682c indicates a faultand sets a corresponding error code for the channel. Step 682d thendetermines if the number of detectors has been exhausted. Steps682e-682o perform the same steps for each of the channels until thechannels are exhausted. The processor then checks to determine in step683a if any faults have been indicated in channel 1. If so, thecorresponding fault light is turned on in step 683b. If not, the channelOK light is turned on in step 683c. This process is repeated until thechannels are exhausted, as illustrated in steps 683d-683l.

Step 684 then queries if any faults have been set. If so, the test modeis entered at step 617. If not, step 685 sets a watch dog timer, whichis used as a timing mechanism to verify the system does not become idleor (hang up) for any period of time.

Control then passes to step 687 which configures the interrupt systemand enables the interrupts. As discussed below, the system is aninterrupt driven system which employs a timing routine which activatesinterrupts to perform specific functions at specific times.

Step 688 performs the foreground task which is used to monitor flags setby various tasks, to save data in the EEPROM and to monitor the serialport for data requests from a remote computer.

The foreground task is illustrated in FIG. 10. As just discussed, theprimary functions of the foreground task are to monitor flags, errorsand requests received from a remote computer. Step 1001 indicates thatthe only entry to the foreground task is through the update historyflag. The foreground task monitors this flag to determine when theforeground task will perform the remaining steps. Thus, if the updatehistory flag has not been set, control merely passes back to the samestep 1001 and the flag is checked again.

Periodically, the update history flag is set. When this occurs, thetotal number of hours will be incremented in step 1003 and history datastored in EEPROM as shown in step 1005. If no errors have occurred, asdetermined in step 1007, the foreground task is complete. If an errorhas occurred, error code 20 is set in step 1009. Step 1011 thendetermines if a request had been received from the remote computer. Ifthis is not the case, processing is complete. If a request has beenreceived from the remote computer, then that request is processed instep 1013 and the foreground task is complete.

As previously indicated, the system is interrupt driven from a timerroutine. FIGS. 7a-7d illustrate the steps in the timer interrupt routinewhich form the heart of system control. An interrupt occurs every onemillisecond. Thus, step 701 resets the one millisecond timer. Next, thewatchdog timer is reset in step 702. Step 703 tests to determine if theelectromagnetic radiation source is being commanded to generateradiation. If not, step 704 determines if the electromagnetic radiationsource has just been turned off. If this is the case, the update historyflag is set in step 705, which will cause activation of the foregroundroutine as previously discussed. If this is not the case or when step705 has set the history flag, control is transferred via step 706.

If the electromagnetic radiation source is being commanded to generate,e.g. X-rays, then a detector hold signal on signal line 517 is set highto activate the sample mode. FIG. 7a indicates that this can beaccomplished by setting bit 3 of a I/O port of microcontroller 513.However, any other means known to those of ordinary skill would also beacceptable and the notation in FIG. 7a is by way of illustration and notlimitation. In step 709 microcontroller 513 commands analog multiplexer509 to select detector number 1. In step 711 the hold signal is set low,which disables the sampling and enables the hold mode. This isaccomplished by setting the same bit 3 of the I/O port to the low state.Microcontroller 513 next activates step 713 which causes A to Dconverter 511 to begin the A to D conversion of the output frommultiplexer 509. This analog to digital conversion is discussed below inmore detail relative to FIGS. 8a and 8b.

While the detector analog to digital conversion takes place,microcontroller 513 sets the pressure sensor hold signal high on line517 in step 715. This enables the sample mode for the pressuretransducers. In step 716, the pressure transducer is selected so thatsamples of the first pressure transducer are obtained. In step 717 thehold signal is set low so that the pressure transducer analog to digitalconversion in step 718 can begin. The pressure transducer analog todigital conversion is discussed in more detail below relative to FIGS.9a and 9b.

It should be apparent that the detector and pressure sampling and analogto digital conversions take place simultaneously. In a preferredembodiment, there is a 30 microsecond delay from the start of thedetector analog to digital conversion in step 713 and the setting of thepressure sensor hold signal high to enable the sample mode in step 715.The processes continue in parallel. In the event that at the end of acycle there is a conflict, priority is resolved for detector interrupts.However, the timer interrupt routine has highest priority.

For convenience, before completing our discussion of the timer interruptroutine in FIG. 7b-7d, we will next discuss the detector analog todigital interrupt routine in FIGS. 8a-8b. In steps 801 and 802, the lowand high bytes are read from the detector analog to digital converter511 and are respectfully combined into a single word 803. In step 804the combined detector data is stored in a data buffer for thatparticular channel. Step 805 then transfers control to perform thedetect/eject algorithm.

The detect/eject algorithm is illustrated in FIGS. 11a-11c. In step1101, the detector data is test to determine if it exceeds apredetermined fail threshold. If not, in step 1102 a fail counter isincremented and, in step 1103, the new value of the fail counter istested against a predetermined fail time. If the fail counter exceedsthe fail time, the a failure has been detected and step 1104 sets a failand board fault for that particular channel. If the detected dataexceeds the fail threshold in step 1101, then the fail counter is resetin step 1105.

Whether the fail counter is reset or the fail counter does not exceedthe fail time, a material detected flag is tested in step 1106. If thematerial detected flag is set, the detector data is next tested againsta start threshold in step 1107. If the detector data exceeds the startthreshold, the material detected flag is reset in 1108 and thedetect/eject algorithm is terminated. If the result of step 1007 is thatthe detector data does not exceed the start threshold then, in step1109, an air off index is incremented to the next buffer position instep 1109. This is repeated in step 1110. The detect/eject algorithm isthen terminated. In summary, if the material detected flag has been set,but the detector data is beneath the start threshold, a large unit ofmaterial has been detected and it is necessary to extend the air on timeuntil the material has cleared the detector. Thus, the air off index ismoved several positions forward, so that the air pressure ejectionmechanism remains turned on for an additional period of time.

As previously discussed, it is necessary to ignore a portion of thematerial being detected. Thus, when the material detected flag is notset in step 1106, step 1111 determines if an ignore count is greaterthan or equal to a start time. If not, the detector data is tested todetermine if it exceeds the start threshold in step 1112. If it does,the "reset all" step 1113 resets the ignore count, an ignore total, thesample count, and the sample count total, and the detect/eject routineis estimated. On the other hand, if the ignore count is not greater thanor equal to the start time, as determined by step 1111, and the detectordata does not exceed the start threshold, as determined by step 1112,step 114 increments the ignore count and terminates the detect/ejectalgorithm.

When the ignore count is greater than or equal to the start time in step1111, in step 1115, the ignore count is tested to determine if it isgreater than or equal to a predetermined ignore time. If this is not thecase, an ignore total is summed with its previous value and the detectordata is tested to determine if it exceeds a start threshold in step1117. If this is not the case, the ignore count is incremented in step1114 and the detect/eject algorithm is terminated. If, on the otherhand, the ignore count is greater than or equal to the start time, butis not greater than or equal to the ignore time, and the detector dataexceeds the start threshold, then an ignore average is calculated instep 1117 to equal the ignore total divided by the difference betweenthe ignore count and the start time.

If the ignore count is greater than or equal to the start time, asdetermined in step 1111, and greater than or equal to the ignore time,as determined in step 1115, a sample interval can begin. In step 1119,the sample count is incremented. The sample total is determined to bethe previous sample total plus the detector data in step 1120. In step1121 the sample count is tested against a predetermined sample time. Ifthe sample count is not greater than or equal to the predeterminedsample time, then in step 1122 the detector data is tested against thestart threshold. If the detector data does not exceed the startthreshold, the detect/eject algorithm is terminated. On the other hand,if the result of step 1122 is that the detector data is greater than thestart threshold, a short sample check is indicated. In step 1123 thesample count is tested to determine if it is greater than or equal tothe minimum number of samples. If this is not the case then an ignoreaverage is calculated in step 1118, previously discussed.

If the sample count is greater than or equal to the minimum number ofsamples or, if in step 1121 the sample count is greater than or equal tothe sample time, then a sample average is calculated in step 1124. Thesample average is the sample total divided by the sample count.

Whether an ignore average is calculated in step 1118 or a sample averageis calculated in step 1124, an event occurred flag is set in step 1125.A material check is then initiated. Step 1126 determines if thecalculated average is less than a predetermined material threshold. Ifthis is not the case, then a non-eject count is incremented in step 1127and in step 1129 the variables ignore count, sample count, and sampletotal are reset. If the calculated average is less than the materialthreshold in step 1126, indices are then set. In step 1129 the air onindex, which indicates when the ejection air will be turned on, is setto a value equal to the present index minus the sample count, minus theignore count, plus the time required for the material to travel from thedetector to the ejection mechanism, minus the response time for thesolenoid to activate the ejection mechanism. In step 1130, an air offindex is calculated to determine when the ejection air will be turnedoff. This is calculated to equal the sum of the air on index and the airon time. In step 1131, a pressure check index, which is used todetermine the time when the air pressure will be checked, is calculated.The pressure check index is equal to the air off index plus the pressurecheck delay time. The eject index is then set to the current value ofthe index in step 1132 and, in step 1133, the material detected flag isset. The use of the material detected flag in step 1106 was previouslydiscussed.

Upon completion of the routine to perform the detect/eject algorithm,control then returns to step 806 in which the detector buffer index isincremented. Essentially, the detector buffer index is an index to thecircular data buffer. In step 807, if the index is greater than thedetector buffer size, the detector buffer is set equal to zero in step808 and, in step 809, the current detector number is incremented. Step810 then tests to determine if the current detector number exceeds thetotal number of detectors. If this is the case, step 811 sets thecurrent detector to zero and control returns to the timer routine atstep 713.

If the incremented or next detector number does not exceed the totalnumber of detectors, then step 812 sets the hold signal high to enablethe sample mode for the incremented detector, which is now the currentdetector. Step 813 sets the current detector by setting the I/O port ofmicrocontroller 513 to the current channel number. In step 814, the holdmode for the detector is set and step 815 starts the detector A to Dconversion. It should be noted that the routine in FIGS. 8a and 8b isthe detector analog to digital conversion interrupt routine. Thus, thisroutine will be executed, along with the detect/eject algorithm routinefor each of the detector channels.

As previously discussed, in step 718 the pressure transducer analog todigital conversion is started. This routine is illustrated in FIGS. 9aand 9b. As FIG. 5 illustrates, the pressure sensor sample and holdcircuits 519 for air valve pressure sensors 521 have outputs which arerouted directly to microcontroller 513. Thus, step 901 involves readingan analog to digital converter which is internal to the microcontroller.In step 902 pressure transducer data is stored in a data buffer for theparticular channel. In step 903 the current pressure transducer numberis incremented so that data for the next channel is obtained. In step904 the incremented transducer number is tested against the maximumnumber of transducers.

If the incremented transducer number exceeds the number of transducers,the transducer number is set to zero in step 905 and an air checkroutine, discussed below is performed. If the transducer number does notexceed the maximum number of transducers then the hold signal is sethigh for the new transducer number to set the sample mode for the nextchannel. This is done in step 906. In step 907, the current transduceris selected by microcontroller 513 and in step 908, the hold mode isselected for that channel. Step 909 starts the transducer A to Dconversion. Thus, steps 901-904 are repeated.

The air check-routine shown in FIG. 9b is performed for the currentchannel on each pass through the transducer interrupt routine, i.e., onechannel is processed per pass through the transducer interrupt routine.In step 910 a current index is checked against a check index. If thecurrent index does not equal the check index, control returns to thetimer interrupt routine at step 718. If the current index is equal tothe check index, then in step 911 the measured pressure is testedagainst the minimum nozzle pressure. If the measured pressure exceedsthe minimum nozzle pressure, control is returned to the timer interruptroutine at step 718. If not, step 912 causes a fault indicator to beactivated and step 913 causes the channel OK light for the channelcorresponding to the current detector to be extinguished. Step 914 thentests to determine if the channel fault has been set. If this is thecase, control returns to the timer interrupt routine in step 718. Ifnot, step 915 sets the channel fault and step 916 outputs an error codefor solenoid failure. FIG. 9b illustrates error codes for solenoidfailures in channels 1-4.

After the error code is output, control can be returned to the timerinterrupt routine. Following the pressure transducer A to D conversionin step 718, the timer interrupt routine transfers control to step 719where the channel one air index is tested to determine if the indexindicates ejection of material. If not, in step 720, the channel one airoff index is tested to determine if it indicates ejection air should beoff. If this is not the case, processing of the remaining channelscontinues. However, if the channel one air off index indicates theejection air should be turned off in channel one, the air solenoid withthe associated detector is turned off in step 721. If the channel 1 airon index indicates the ejection air should be turned on in step 719,step 723 activates the air solenoid associated with the correspondingdetector and step 724 increments the channel eject counter. Steps725-739 indicate the same process takes place in each of the fourchannels as that described in steps 719-724.

At the completion for all four channels, or as many channels as exist inthe system, or after the history update flag has been set in step 705,or if the electromagnetic radiation source is turned off and has notbeen recently turned off, as in step 704, the timer interrupt routineexecutes step 740 to increment the interrupt counter. Since an interruptoccurs every one millisecond, sixty thousand interrupts occur in oneminute. The elapse of one minute by the count of sixty thousandinterrupts is determined in step 741. For each elapsed minute, step 742increments a minute counter. Step 743 then tests to determine if an hourhas elapsed. If this is the case, the update history flag is set as anindicator to the foreground task to update historical information. Theforeground task is always monitoring this flag.

While several embodiments of the invention have been described, it willbe understood that it is capable of further modifications, and thisapplication is intended to cover any variations, uses, or adaptations ofthe invention, following in general the principles of the invention andincluding such departures from the present disclosure as to come withinknowledge or customary practice in the art to which the inventionpertains, and as may be applied to the essential features hereinbeforeset forth and falling within the scope of the invention or the limits ofthe appended claims.

What is claimed is:
 1. A method of separating materials having differentelectromagnetic radiation absorption and penetration characteristics,the method comprising the steps of:a) conveying materials to beseparated from at least one inlet toward at least one outlet through asource of electromagnetic radiation; b) irradiating portions of thematerials conveyed with the source of electromagnetic radiation; c)periodically polling a sequence of detectors, the detectorscorresponding to channels, said polling including sampling for a sampletime with the detectors the electromagnetic absorption and penetrationcharacteristics of the material portions radiated; d) in response toelectromagnetic radiation absorption and penetration characteristicsmeasured by the detectors in step c), activating a plurality of materialejection mechanisms at different times as the materials are conveyed, sothat materials having different electromagnetic radiation andpenetration characteristics are ejected at different times and locationson the conveyor into different sorting bins; and e) during step d)verifying the operation of the material ejection mechanisms.
 2. Themethod recited in claim 1 wherein each channel has at least one ejectionmechanism.
 3. The method recited in claim 1 wherein each channel has atleast one the ejection mechanism, the ejection mechanisms beingcomprised of air pressure ejectors and wherein step d) comprises:i)measuring and storing air pressure data from each ejection mechanism ina sequence identical to the sequence of the detectors polled; ii)indicating a fault if the air pressure data measured and stored in stepa) is less than a predetermined minimum.
 4. The method recited in claim1 wherein a leading edge portion of each item of material to beseparated in each channel is ignored.
 5. A method of separatingmaterials having different electromagnetic radiation absorption andpenetration characteristics, the method comprising the steps of:a)conveying materials to be separated in from at least one inlet toward atleast one outlet through a source of electromagnetic radiation; b)irradiating portions of the materials conveyed with the source ofelectromagnetic radiation; c) periodically polling a sequence ofdetectors, the detectors corresponding to channels, said pollingincluding sampling for a sample time with the detectors theelectromagnetic absorption and penetration characteristics of thematerial portions radiated wherein an ignore .[.table.]. .Iadd.time.Iaddend.is counted from the time when a detection is made and whereinsampling taking place during the ignore time is ignored; and d) inresponse to electromagnetic radiation absorption and penetrationcharacteristics measured by the detectors in step c), activating aplurality of the material ejection mechanisms at different times as thematerials are conveyed, so that materials having differentelectromagnetic radiation and penetration characteristics are ejected atdifferent times and locations on the conveyor into different sortingbins.
 6. The method recited in claim 5 wherein in step c) outputs of thedetectors are sampled a plurality of times during a sample interval anda sample average is determined from the detector outputs and a count ofthe number of samples during the sample interval.
 7. The method recitedin claim 6 wherein the average is compared to a predetermined materialthreshold defined by a ratio of a predetermined amount of radiationtransmitted through a material to an amount of radiation transmitted inthe absence of the material.
 8. The method recited in claim 7 whereinthe ejection mechanisms are air pressure ejection mechanisms andwherein, when the average is less than the predetermined materialthreshold, step d) further comprises setting an air on index to activatethe air ejection mechanisms at a time and for a duration based on thesample count, the ignore count, a travel time for the material to gofrom the detectors to the air pressure ejection mechanism and a responsetime of a solenoid which activates the individual air ejectionmechanisms.
 9. The method recited in claim 8 wherein the air on index isdetermined from a current index as: ##EQU1##10.
 10. The method recitedin claim 8 wherein an air off index is defined as a sum of the air onindex and the air on time and is used to turn the air ejectionmechanisms off.
 11. The method recited in claim 10 wherein step d)comprises: i) measuring and storing air pressure data from each ejectionmechanism in a sequence identical to the sequence of the detectorspolled; andii) indicating a fault if the air pressure data measured andstored in step a) is less than a predetermined minimum.
 12. The methodrecited in claim 11 wherein a pressure check index is defined as a sumof the air off index and a pressure check delay and is used to activateverification of the air pressure data in each ejection mechanism. 13.The method recited in claim 5 further comprising an initializationsequence wherein:variables are initialized and checked via a checksumroutine; detectors and ejection mechanisms are compared forcorrespondence; low and high limits of detectors and ejection mechanismsare tested; and operation of fault indicators is verified.
 14. Themethod recited in claim 5 wherein a foreground routine is performed, theforeground routine monitoring total operation time, recording errors andstoring histories.
 15. The method recited in claim 14 wherein theforeground routine is periodically interrupted to store processinghistories.
 16. The method recited in claim 5 wherein control ismaintained by a current index representing a pointer in a circularbuffer, the index being a location where current information is stored.17. The method recited in claim 5 wherein each channel has at least onedetector and at least one ejection mechanism.
 18. The method recited inclaim 5 wherein detections from a plurality of channels of detectors arecombined to activate a same one of the ejection mechanisms.
 19. Anapparatus for separating materials having different electromagneticradiation absorption and penetration characteristics, the apparatuscomprising:a) a conveyor arranged to convey materials to be separatedfrom at least one inlet toward at least one outlet; b) anelectromagnetic radiation source arranged along said conveyor toirradiate portions of the materials conveyed; c) a plurality ofdetectors, the detectors corresponding to channels, the detectorsmeasuring electromagnetic absorption and penetration characteristics ofthe material portions radiated; d) means for periodically polling asequence of detectors, said polling means including a sampler arrangedto sample the detectors for a sample time; e) a plurality of ejectionmechanisms, at least one ejection mechanism corresponding to eachoutlet; f) means for activating the material ejection mechanisms atdifferent times as the materials are conveyed, in response toelectromagnetic radiation absorption and penetration characteristicsmeasured by the detectors, so that materials having differentelectromagnetic radiation and penetration characteristics are ejected atdifferent times and locations on the conveyor into different sortingbins; and g) means for verifying operation of the material ejectionmechanisms during time period when the detectors are measuringelectromagnetic absorption and penetration characteristics of thematerial portions radiated.
 20. The apparatus recited in claim 19wherein each channel has at least one ejection mechanism, the ejectionmechanisms being comprised of air pressure ejectors, the apparatusfurther comprising:f) means for measuring and storing air pressure datafrom each ejection mechanism in a sequence identical to the sequence ofthe detectors polled; and g) fault indicators indicating a fault if theair pressure data measured and stored is less than a predeterminedminimum.
 21. The apparatus recited in claim 19 comprising means forignoring a leading edge portion of each item of material to be separatedin each channel.
 22. An apparatus for separating materials havingdifferent electromagnetic radiation absorption and penetrationcharacteristics, the apparatus comprising:a) a conveyor arranged toconvey materials to be separated from at least one inlet toward at leastone outlet; b) an electromagnetic radiation source arranged along saidconveyor to irradiate portions of the materials conveyed; c) a pluralityof detectors, the detectors corresponding to channels, the detectorsmeasuring electromagnetic absorption and penetration characteristics ofthe material portions radiated; d) means for periodically polling asequence of detectors, said polling means including a sampler arrangedto sample the detectors for a sample time; e) an ignore time counter,said ignore time counter counting from a time when a detection is madeto a later time defining the ignore time and wherein sampling takingplace during the ignore time is ignored; and f) a plurality of ejectionmechanisms, at least one ejection mechanism corresponding to eachoutlet; and g) means for activating the material ejection mechanisms atdifferent times as the materials are conveyed, in response toelectromagnetic radiation absorption and penetration characteristicsmeasured by the detectors, so that materials having differentelectromagnetic radiation and penetration characteristics are ejected atdifferent times and locations on the conveyor into different sortingbins.
 23. The apparatus recited in claim 22 wherein outputs of thedetectors are sampled a plurality of times during a sample interval anda sample average is determined from the detector outputs and a count ofthe number of samples during the sample interval.
 24. The apparatusrecited in claim 23 wherein the average is compared to a predeterminedmaterial threshold.
 25. The apparatus recited in claim 24 furthercomprising an air on index and wherein the ejection mechanisms are airpressure ejection mechanisms and wherein, when the average is less thanthe predetermined material threshold the air on index is set to activatethe air ejection mechanisms at a time and for a duration based on thesample count, the ignore count, a travel time for the material to gofrom the detectors to the air pressure ejection mechanism and a responsetime of a solenoid which activates the individual air ejectionmechanisms.
 26. The apparatus recited in claim 25 wherein the air onindex is determined from a current index as: ##EQU2##
 27. The apparatusrecited in claim 25 wherein an air off index is defined as a sum of theair on index and the air on time and is used to turn the air ejectionmechanisms off.
 28. The apparatus recited in claim 27 comprising: f)means for measuring and storing air pressure data from each ejectionmechanism in a sequence identical to the sequence of the detectorspolled; andg) fault indicators indicating a fault if the air pressuredata measured and stored is less than a predetermined minimum.
 29. Theapparatus recited in claim 28 wherein a pressure check index is definedas a sum of the air off index and a pressure check delay and is used toactivate verification of the air pressure data in each ejectionmechanism.
 30. The apparatus recited in claim 22 further comprising aninitialization sequence means wherein:variables are initialized andchecked via a checksum routine; numbers of detectors and ejectionmechanisms are compared for one to one correspondence; low and highlimits of detectors and ejection mechanisms are tested; and operation offault indicators is verified.
 31. The apparatus recited in claim 22further comprising means for performing a foreground routine where theforeground routine monitors total operation time, records errors andstores histories.
 32. The apparatus recited in claim 31 wherein theforeground routine is periodically interrupted to store processinghistories.
 33. The apparatus recited in claim 22 comprising a circularbuffer, wherein control is maintained by a current index representing apointer in a circular buffer, the index being a location where currentinformation is stored.
 34. The apparatus recited in claim 22 wherein aplurality of detectors combine to activate a same one of the ejectionmechanisms.
 35. A method of separating .Iadd.PVC and non-PVC materials,said .Iaddend.materials having different .[.electromagnetic.]..Iadd.X-ray .Iaddend.radiation absorption and penetrationcharacteristics, the method comprising the steps of:a) conveying.Iadd.PVC and non-PVC .Iaddend.materials to be separated from at leastone inlet toward at least one outlet through a source of.[.electromagnetic.]. .Iadd.X-ray .Iaddend.radiation; b) irradiatingportions of the .Iadd.PVC and non-PVC .Iaddend.materials conveyed withthe source of .[.electromagnetic.]. .Iadd.X-ray .Iaddend.radiation at aselected energy level; c) periodically polling a sequence of .Iadd.X-ray.Iaddend.detectors, the detectors corresponding to channels, saidpolling including sampling for a sample time with the detectors at leastone of absolute .[.electromagnetic.]. .Iadd.X-ray .Iaddend.radiationabsorption and penetration characteristics of the material portionsradiated; .Iadd.and .Iaddend. d) in response to the absolute.[.electromagnetic.]. .Iadd.X-ray .Iaddend.radiation characteristicsmeasured by the detectors in step c), .Iadd.categorizing readings forportions irradiated into at least one of a plurality of classes, saidclasses corresponding to different X-ray radiation absorption andpenetration characteristics, determining that readings in at least oneof said classes are a more reliable indication of material type thanreadings in another of said classes, and based on said more reliableindication of material type, .Iaddend.activating a plurality of materialejection mechanisms at different times as the .Iadd.PVC and non-PVC.Iaddend.materials are conveyed, so that materials.Iadd.,.Iaddend.having different absolute .[.electromagnetic.]. .Iadd.X-ray.Iaddend.radiation and penetration characteristics.Iadd., .Iaddend.areejected at different times and locations on the conveyor into differentsorting bins. .Iadd.
 36. A method of separating PVC and non-PVCmaterials, said materials having different X-ray radiation absorptionand penetration characteristics, as set forth in claim 35, furthercomprising the step of:e) during step d) verifying the operation of thematerial ejection mechanisms. .Iaddend.